package com.yiwyn.springmixedsql.service;

import com.yiwyn.springmixedsql.domain.TestUsers;
import com.yiwyn.springmixedsql.mapper.TestUsersMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserService {

    @Autowired
    private TestUsersMapper testUsersMapper;


    public void getUser(Long id) {
        long start = System.nanoTime();
        TestUsers testUsers = testUsersMapper.selectByPrimaryKey(id);
        long end = System.nanoTime();
        log.info("消耗时间:{}", (end - start));
    }

}
